package com.census.entity;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;

/**
 * Created by WangKai's Hands.
 * User:WangKai
 * Date:2017/6/30
 * Time:2:35
 * Email: 1786025737@qq.com
 */
public class PersonalinfoPK implements Serializable {
    private int userId;
    private String cardId;

    @Column(name = "user_id")
    @Id
    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    @Column(name = "card_id")
    @Id
    public String getCardId() {
        return cardId;
    }

    public void setCardId(String cardId) {
        this.cardId = cardId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        PersonalinfoPK that = (PersonalinfoPK) o;

        if (userId != that.userId) return false;
        if (cardId != null ? !cardId.equals(that.cardId) : that.cardId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = userId;
        result = 31 * result + (cardId != null ? cardId.hashCode() : 0);
        return result;
    }
}
